<template>
  <div class="father">
    <h2>父组件</h2>
    <div class="category-container">
      <Category title="美食">
        <span>{{ foods }}</span>
        <template #footer>
          <div>我要住在具名插槽里</div>
        </template>
      </Category>
      <Category title="游戏">
        <template v-slot:footer>
          <ul>
            <li v-for="game in games" :key="game.id">{{ game.name }}</li>
          </ul>
        </template>
      </Category>
      <Category title="影视">
        <ul>
          <li v-for="movie in movies" :key="movie.id">{{ movie.name }}</li>
        </ul>
      </Category>
    </div>
  </div>
</template>

<script setup lang="ts">
import Category from './Category.vue'


let games = [
  { id: 1, name: '塞尔达传说' },
  { id: 2, name: '原神' },
  { id: 3, name: '巫师3' },
]
let movies = [
  { id: 1, name: '肖申克的救赎' },
  { id: 2, name: '霸王别姬' },
  { id: 3, name: '阿甘正传' },
]
let foods = '汉堡 披萨 寿司'



</script>

<style scoped>
.father {
  padding: 20px;
  background-color: rgb(165, 164, 164);
  border-radius: 10px;
}

.category-container {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
</style>